﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using model;
using System.Data;

namespace Dal
{
    public class ResumeSDal
    {
        public List<ResumeS> GetList(string sword, string kword)
        {
            StringBuilder sql = new StringBuilder("select * from Student,Resume where Resume.sno= Student.sno");
            if (string.IsNullOrEmpty(kword) == false)
                sql.Append(" and " + sword + " like '%" + kword + "%'");
            DataSet ds = DbSqlHelper.Query(sql.ToString());
            List<ResumeS> datas = new List<ResumeS>();
            ResumeS rs;
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                rs = new ResumeS();
                rs.Sno = row["sno"].ToString();
                rs.Rno =Convert.ToInt32(row["rno"].ToString());
                rs.Ssex = row["ssex"].ToString();
                rs.Smajor = row["major"].ToString();
                rs.Sname = row["sname"].ToString();
                rs.Huji = row["huji"].ToString();
                datas.Add(rs);
            }
            return datas;
        }
    }
}
